package com.anytrek.cloudopenfeign.openfeign;

import com.anytrek.cloudcommon.utils.ApiResult;
import com.anytrek.cloudopenfeign.fallback.UsersClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ ClassName UsersClient
 * @ Author Alex2
 * @ Date 2025/8/23 11:25
 **/
@FeignClient(name = "cloud-user",path = "/users",fallbackFactory = UsersClientFallbackFactory.class)
public interface UsersClient {

    @GetMapping("/getUserById")
    ApiResult getUserById(@RequestParam("id") Integer id);

    @GetMapping("/deductBalance")
    ApiResult deductBalance(@RequestParam("id") Integer id, @RequestParam("amount") Integer amount);
}